class daocheng::eos(
   $enable_eos = true,
)
{
if $enable_eos {

  if 0 + $operatingsystemmajrelease >=7 {
    package { ["xrootd-client",
                "xrootd-devel",
                "xrootd-client-libs",
                "xrootd-libs"]:
        ensure   => "installed",
        require  => Yumrepo['site'],
    }
  }
  else {
    package { ["xrootd-client",
                  "xrootd-devel",
                  "xrootd-client-libs",
                  "xrootd-compat-client-libs",
                  "xrootd-compat-libs",
                  "xrootd-libs"]:
        ensure   => "installed",
        require  => Yumrepo['site'],
    }
  }->
  package { ["eos-fuse-core",
             "eos-client",
             "eos-fuse-sysv"]:
      ensure   => "installed",
      #require  => Yumrepo['eos'],
  }
}

  #autofs
  augeas { "autofs_conf":
    context => "/files/etc/autofs.conf/autofs",
    changes => [
      "set browse_mode yes",
    ],
  }
  file {"/etc/autofs.conf":
    mode       =>  '644',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/autofs.conf",
  }
  #file {"/etc/auto.master.d/eos.autofs":
  #  mode       =>  '644',
  #  owner      =>  'root',
  #  group      =>  'root',
  #  source     =>  "puppet:///modules/${module_name}/eos.autofs",
  #}
  file {"/etc/auto.master.d/eos.autofs":
    ensure       =>  absent,
  }
  file {"/etc/autofs.eos":
    ensure       =>  absent,
  }

  #file {"/etc/auto.eos":
  #  mode       =>  '644',
  #  owner      =>  'root',
  #  group      =>  'root',
  #  source     =>  "puppet:///modules/${module_name}/auto.eos",
  #}
  file {"/etc/sysconfig/eos.daocheng":
    mode       =>  '644',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/eos.daocheng",
  }
  file {"/etc/sysconfig/eos":
    mode       =>  '644',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/eos",
  }
  file {"/etc/profile.d/eos.sh":
    mode       =>  '755',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/eos.sh",
  }
  file {"/etc/profile.d/eos.csh":
    mode       =>  '755',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/eos.csh",
  }
}
